package com.ny.controller;

import com.ny.entity.DeviceNew;
import com.ny.mapper.DeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/devices")
public class DeviceNewController {
    @Autowired
    private DeviceService deviceService;

    // GET请求查询所有设备
    @GetMapping
    public List<DeviceNew> getAllDevices() {
        return deviceService.getAllDevices();
    }
}